<template>
	<view class="containers">
		<plublic-navbar :is-back="true" :title="title" :background="background" :titleColor="color"></plublic-navbar>
		<!-- <view class="smenu">

			<view class="li u-flex u-row-between" @click="goPage('/pages/company/company')">
				<view class="u-flex u-col-center">
					<u-icon label="账号安全" size="24" :name="imgUrl+'common/anquan.png'"></u-icon>
		
				</view>
				<u-icon name="arrow-right" size="14" color="#84929A"></u-icon>
			</view>
		
		</view> -->
		<view class="smenu" :style="'margin-top:'+top/2+'px'">
			<!-- <navigator url="/pages/demand/demand?type=1" hover-class=""> -->
			<view class="li u-flex u-row-between" @click="goPage('/pages/about/about?id=4')">
				<view class="u-flex u-col-center">
					<u-icon label="隐私保护" size="24" :name="imgUrl+'common/dingdan.png'"></u-icon>
					<!-- <text class="name">帮助中心</text> -->
				</view>
				<u-icon name="arrow-right" size="14" color="#84929A"></u-icon>
			</view>
			<!-- </navigator> -->
			<!-- <navigator url="/pages/jsxq_list/jsxq_list" hover-class=""> -->
			<view class="li u-flex u-row-between" @click="goPage('/pages/about/about?id=5')">
				<view class="u-flex u-col-center">
					<u-icon label="关于我们" size="24" :name="imgUrl+'common/guanyu.png'"></u-icon>
					<!-- <text class="name">出游人</text> -->
				</view>
				<u-icon name="arrow-right" size="14" color="#84929A"></u-icon>
			</view>
			<!-- </navigator> -->
			
		</view>
		<view class="smenu">
		
			<!-- <navigator url="/pages/demand/demand?type=2" hover-class=""> -->
			<view class="li u-flex u-row-between" @click="logout">
				<view class="u-flex u-col-center">
					<u-icon label="退出登录" size="24" :name="imgUrl+'common/tuichu.png'"></u-icon>
					<!-- <text class="name">我要投稿</text> -->
				</view>
				<u-icon name="arrow-right" size="14" color="#84929A"></u-icon>
			</view>
		</view>
	</view>
</template>

<script>
	import {loginUrl} from '../../common/mixin.js';
	import {logout} from '../../common/api.js';
	export default {
		mixins: [loginUrl],
		data() {
			return {
				baseUrl:uni.$u.http.config.baseURL,
				imgUrl:uni.$u.http.config.imgURl,
				background:'#ffffff',
				title:'设置',
				top:0,
			}
		},
		onLoad() {
			let that =this
			uni.getStorage({
				key: 'top',
				success: function (res) {
					that.top = res.data;
					console.log(res.data);
				}
			});
		},
		methods: {
			goPage(e){
				if(this.isLogin(e)){
					this.globals.linkJump({
					  url:e,
					  callback: () => {
					    uni.setStorageSync('pagelist',e)
					  }
					});
					// uni.navigateTo({
					// 	url: e
					// })
				}
			
			},
			logout(){
				logout().then(res=>{
						this.$u.toast("退出成功");
				}).catch(err=>{
					console.log('失败',err)
				
				})
				// uni.setStorageSync('userInfo','')
				// uni.setStorageSync('expiresTime','')
				// uni.setStorageSync('refreshToken','')
				// uni.setStorageSync('openId','')
				
				uni.removeStorageSync('userInfo');
				uni.removeStorageSync('expiresTime');
				uni.removeStorageSync('refreshToken');
				uni.removeStorageSync('openId');
				uni.removeStorageSync('planData');
				this.$u.vuex('vuex_token', '')
				this.$u.vuex('vuex_user', '')
				
				uni.switchTab({
					url:'/pages/index/index'
				})
				// this.goPage('/pages/index/index')
				
			}
		}
	}
</script>

<style lang="scss">
	page{
		background: #F5F5F5;
		height:100%;
		width:100%;
		
	}
	.containers{
		padding: 20rpx;
	}
	.smenu{
		width: 100%;
		margin-top: 32rpx;
		background-color: #ffffff;
		border-radius: 24rpx;
		box-shadow: 0px 10px 20px 0px rgba(0,0,0,0.1);
		padding: 0 34rpx;
		.li{
			height: 110rpx;
			line-height: 110rpx;
			border-bottom: #E7E9EA solid 2rpx;
		}
		.li:last-child{
			border-bottom:none
		}
		::v-deep .u-icon__label{
			font-size: 32rpx !important;
			color: #002A3A !important;
		}
	}
</style>
